// 在 example.js 中定义一个函数来加载地图 API
export function loadMapAPI() {
    return new Promise((resolve, reject) => {
      const script = document.createElement('script');
      script.type = 'text/javascript';
      script.src = 'https://api.map.baidu.com/api?v=1.0&type=webgl&ak=YLKMWdMiu6rlSOIpRGZMuGBDw5sBOACf';
      script.onload = () => {
        resolve();
      };
      script.onerror = () => {
        reject(new Error('加载地图API失败'));
      };
      document.head.appendChild(script);
    });
  }